<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello mdui</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<script type="text/javascript" src="../../statics/common/js/header.js"></script>
		<!--标准mdui.css-->
		<link rel="stylesheet" href="../../statics/mdui/css/mdui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../../statics/mdui/css/app.css" />
		<style>
			.mdui-row.mdui-fullscreen>[class*="mdui-col-"] {
				height: 100%;
			}
			.mdui-col-xs-3,
			.mdui-control-content {
				overflow-y: auto;
				height: 100%;
			}
			.mdui-segmented-control .mdui-control-item {
				line-height: 50px;
				width: 100%;
			}
			.mdui-segmented-control.mdui-segmented-control-inverted .mdui-control-item.mdui-active {
				background-color: #fff;
			}
		</style>
	</head>

	<body>
		<header class="mdui-bar mdui-bar-nav">
			<a class="mdui-action-back mdui-icon mdui-icon-left-nav mdui-pull-left"></a>
			<h1 class="mdui-title">侧面选项卡-div模式</h1>
		</header>
		<div class="mdui-content mdui-row mdui-fullscreen">
			<div class="mdui-col-xs-3">
				<div id="segmentedControls" class="mdui-segmented-control mdui-segmented-control-inverted mdui-segmented-control-vertical">
				</div>
			</div>
			<div id="segmentedControlContents" class="mdui-col-xs-9" style="border-left: 1px solid #c8c7cc;">
				<div id="item1" class="mdui-control-content mdui-active">
				</div>
				<div id="item2" class="mdui-control-content">
				</div>
				<div id="item3" class="mdui-control-content">
				</div>
			</div>
		</div>
		<script src="../../statics/mdui/js/mdui.min.js"></script>
		<script>
			mdui.init({
				swipeBack: true //启用右滑关闭功能
			});
			var controls = document.getElementById("segmentedControls");
			var contents = document.getElementById("segmentedControlContents");
			var html = [];
			var i = 1,
				j = 1,
				m = 16, //左侧选项卡数量+1
				n = 21; //每个选项卡列表数量+1
			for (; i < m; i++) {
				html.push('<a class="mdui-control-item" href="#content' + i + '">选项' + i + '</a>');
			}
			controls.innerHTML = html.join('');
			html = [];
			for (i = 1; i < m; i++) {
				html.push('<div id="content' + i + '" class="mdui-control-content"><ul class="mdui-table-view">');
				for (j = 1; j < n; j++) {
					html.push('<li class="mdui-table-view-cell">第' + i + '个选项卡子项-' + j + '</li>');
				}
				html.push('</ul></div>');
			}
			contents.innerHTML = html.join('');
			 //默认选中第一个
			controls.querySelector('.mdui-control-item').classList.add('mdui-active');
			contents.querySelector('.mdui-control-content').classList.add('mdui-active');
		</script>

	</body>

</html>